package cc.linker.steplink.crm.dao;

import cc.linker.steplink.crm.domain.Level;
import org.apache.ibatis.annotations.Param;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface LevelDao {

    List<Map<String, Object>> listLevels(Map map);

    List<Map<String,Object>> getCustomerListByLevel(@Param("orgId") String orgId);

    int addLevel(Map record);

    int deleteByPrimaryKey(String levelId);

    Integer getLastOrderByOrgId(String orgId);

    String getLastLevelId(String orgId);

    HashMap<String, Object> getLevelInfo(String levelId);

    int editLevel(Map record);

    String getLastLevelName(Map map);

    int insertSelective(Level record);

    Level selectByPrimaryKey(String levelId);

    int updateByPrimaryKeySelective(Level record);

    int updateByPrimaryKey(Level record);

    Integer getLastScore(String orgId);

    HashMap<String, Object> getPreLevelInfo(Map map);

    HashMap<String, Object> getNextLevelInfo(Map map);

    String getLevelNameByScore(@Param("orgId") String orgId, @Param("customerScore") Long customerScore);

    String getLevelGiftsByScore(@Param("orgId") String orgId, @Param("customerScore") Long customerScore);

    int selectISsaler(String customerId);

    String getLevelNameByCustomerId(String id);

    Integer getThisOrder(@Param("levelId") String levelId,@Param("orgId")  String orgId);

    void setIntegralGoods(@Param("quotaLevel") Integer quotaLevel,@Param("orgId")  String orgId);

    void updateCustomerLevelId(@Param("customerLevelId") String customerLevelId,@Param("newId")  String newId);

    void updateCustomerLevelIdByZeroScore(@Param("levelId") String levelId,@Param("orgId") String orgId);

    void removeCustomerLevelId(@Param("levelId") String levelId);

}